﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Billing.DataObjects;

namespace DGTestApp
{
    public partial class Form2 : System.Windows.Forms.Form
    {
        Billing.DataObjects.BillingDataContext context = new Billing.DataObjects.BillingDataContext();

        public Form2()
        {
            InitializeComponent();
            foreach (ClientStatuse cs in context.ClientStatuses)
            {
                checkedListBox1.Items.Add(new ListItem(cs.Name, cs.ID.ToString()), false);
            }
        }

        private class ListItem
        {
            public string Text { get; set; }
            public string Value { get; set; }
            public override string ToString()
            {
                return Text;
            }

            public ListItem()
                : this(string.Empty, string.Empty)
            {

            }
            public ListItem(string Text, string Value)
            {
                this.Text = Text;
                this.Value = Value;
            }

        }
    }
  
}
